package main

import "fmt"

// 阶乘
func factorial(a int) int {
	if a == 0 {
		return 1
	}
	return a * factorial(a-1)
}

// 递归斐波拉且数列
func fibonacci(a int) int {
	if a <= 1 {
		return a
	}
	return fibonacci(a-1) + fibonacci(a-2)
}

func main() {
	num := 2
	fmt.Printf("%d的阶乘为%d \n", num, factorial(num))

	for i := 0; i < 10; i++ {
		fmt.Printf("F(%d) = %d\n", i, fibonacci(i))
	}
}
